/* ===== BASE STYLES ===== */
:root {
  /* Header & Footer Colors */
  --header-bg-start: #3f51b5; /* Deeper blue for gradient start */
  --header-bg-end: #673ab7;   /* Purple for gradient end */
  --header-text-color: #ffffff;
  --footer-bg-color: #2c3e50; /* Dark blue-grey */
  --footer-text-color: #cccccc;
  --footer-link-color: #eeeeee;

  /* Specific to PDF to Image Converter Page */
  --body-bg-gradient-start: #1e3c72;
  --body-bg-gradient-end: #2a5298;
  --body-text-color: white; /* Changed for overall readability on dark background */
  --container-bg: #1f1f2e;
  --container-shadow: rgba(0, 0, 0, 0.5);
  --page-title-color: #00f9ff;
  --btn-bg: #00f9ff;
  --btn-color: #1f1f2e;
  --btn-hover-bg: #00d4e4;
  --btn-outline-color: #00f9ff;
  --drop-area-border: #00f9ff;
  --drop-area-bg: rgba(255, 255, 255, 0.05);
  --drop-area-hover-bg: rgba(0, 249, 255, 0.1);
  --preview-border: #00f9ff;

  /* Info Section Specific Colors (re-themed for this page) */
  --info-section-bg: #ffffff;
  --info-section-shadow: rgba(0, 0, 0, 0.08);
  --info-h1-color: #1c3d5a; /* Main heading in info section */
  --info-h2-color: #1c3d5a;
  --info-h3-color: #1c3d5a;
  --info-text-color: #333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(to right, var(--body-bg-gradient-start), var(--body-bg-gradient-end));
  color: var(--body-text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column; /* Stack header, main, footer vertically */
}

/* ===== HEADER STYLES ===== */
.main-header {
  background: linear-gradient(135deg, var(--header-bg-start), var(--header-bg-end));
  padding: 15px 30px;
  color: var(--header-text-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-section {
  display: flex;
  align-items: center;
}

.header-logo-img {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.918);
  padding: 2px;
}

.site-title {
  font-size: 24px;
  font-weight: bold;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
}

.main-nav ul li a {
  color: var(--header-text-color);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.main-nav ul li a:hover {
  opacity: 0.8;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 6px;
}

.hamburger-menu .bar {
  width: 25px;
  height: 3px;
  background-color: var(--header-text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-nav {
  display: none;
  background: var(--header-bg-end);
  width: 100%;
  position: absolute;
  top: 70px; /* Height of header + padding */
  left: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 999;
}

.mobile-nav.active {
  display: block;
  transform: translateY(0);
}

.mobile-nav ul {
  list-style: none;
  padding: 10px 0;
  text-align: center;
}

.mobile-nav ul li {
  padding: 12px 20px;
}

.mobile-nav ul li a {
  color: var(--header-text-color);
  text-decoration: none;
  font-size: 18px;
  display: block;
}

.mobile-nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

/* Hamburger animation */
.hamburger-menu.active .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ===== MAIN CONTENT WRAPPER ===== */
.content-wrapper {
  flex-grow: 1; /* Allows main content to take available space */
  width: 100%;
  max-width: 1200px; /* Consistent max-width for main content */
  margin: 0 auto; /* Center the wrapper */
  padding: 20px; /* Overall padding for the content area */
  display: flex;
  flex-direction: column;
  align-items: center; /* Center the container and sections */
  box-sizing: border-box;
}

/* ===== CONTAINER STYLES (for the tool itself) ===== */
.container {
  background: var(--container-bg);
  padding: 30px;
  border-radius: 15px;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 0 30px var(--container-shadow);
  text-align: center;
  margin-bottom: 2rem; /* Space before sections */
}

/* Removed .home-button as it's now handled by the main header */

.page-title { /* Renamed from h1-header for clarity and consistency */
  color: var(--page-title-color);
  margin-bottom: 20px;
  font-size: 28px; /* Slightly larger title */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.icon-small {
  width: 50px;
  height: 50px;
  vertical-align: middle;
  margin-right: 16px;
  margin-left: 16px; /* Keep consistent spacing */
}

.top-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px; /* Increased margin */
  flex-wrap: wrap;
}

.btn, .btn-outline {
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
  text-decoration: none; /* Ensure buttons as links look consistent */
  display: inline-block; /* For proper padding and margin */
}

.btn {
  background-color: var(--btn-bg);
  color: var(--btn-color);
  border: none;
}

.btn:hover {
  background-color: var(--btn-hover-bg);
}

.btn-outline {
  background: transparent;
  color: var(--btn-outline-color);
  border: 2px solid var(--btn-outline-color);
}

.btn-outline:hover {
  background-color: rgba(0, 249, 255, 0.1);
}

.drop-area {
  border: 2px dashed var(--drop-area-border);
  padding: 40px 20px;
  border-radius: 10px;
  background-color: var(--drop-area-bg);
  cursor: pointer;
  margin-bottom: 20px;
}

.drop-area:hover {
  background-color: rgba(0, 249, 255, 0.1);
}

.drop-area span {
  color: var(--drop-area-border);
  text-decoration: underline;
}

input[type="file"] {
  display: none;
}

.preview {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.preview canvas {
  margin-bottom: 0; /* Remove extra margin if flexbox handles spacing */
  max-width: 100%;
  height: auto; /* Ensure responsiveness */
  border: 1px solid var(--preview-border);
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Added shadow for better separation */
}

/* ===== INFO SECTION STYLES ===== */
.info-section { /* Renamed from 'section' to avoid conflict */
  background-color: var(--info-section-bg);
  margin: 30px auto;
  padding: 25px;
  max-width: 850px;
  border-radius: 10px;
  box-shadow: 0 0 15px var(--info-section-shadow);
  width: 100%; /* Ensure it uses full width of content-wrapper */
  color: initial; /* Reset section text color to default black */
}

.info-section .info-header-h1 { /* Specific style for the main H1 in info section */
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--info-h1-color);
  text-align: left; /* Default alignment */
  justify-content: flex-start; /* Align content to start */
}

.info-section h2 {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: var(--info-h2-color);
  font-size: 26px;
  margin-bottom: 12px;
  margin-top: 25px;
  text-align: left; /* Default alignment */
}

.info-section h3 {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: var(--info-h3-color);
  font-size: 20px;
  margin-top: 20px;
  text-align: left; /* Default alignment */
}

.info-section p, .info-section li {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: var(--info-text-color);
  font-size: 17px;
  line-height: 1.7;
  text-align: justify;
}

.info-section ul, .info-section ol {
  padding-left: 22px;
  margin-top: 10px; /* Added margin for list spacing */
}

.info-section li {
  margin-bottom: 8px;
}


/* ===== FOOTER STYLES ===== */
.main-footer {
  background-color: var(--footer-bg-color);
  color: var(--footer-text-color);
  padding: 40px 20px 20px;
  margin-top: auto; /* Pushes footer to the bottom */
  width: 100%;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section {
  padding: 10px;
  text-align: left;
}

.footer-logo-section {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.footer-logo-img {
  width: 35px;
  height: 35px;
  margin-right: 10px;
  border-radius: 0.5rem;
  background: #fefeff;
  padding: 2px;
}

.footer-site-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--footer-link-color);
}

.footer-section h3 {
  color: var(--footer-link-color);
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-section p {
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 0;
  color: var(--footer-text-color);
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: var(--footer-text-color);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--footer-link-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 14px;
  color: var(--footer-text-color);
}

/* ===== STICKY CHAT ICON STYLES ===== */
.sticky-chat-icon {
  display: inline-block;
  text-decoration: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  cursor: pointer;
}

.sticky-chat-icon > div:first-child { /* The inner circle */
  width: 50px;
  height: 50px;
  background-color: #8800f8;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.sticky-chat-icon svg { /* The SVG icon */
  width: 25px;
  height: 25px;
  fill: white;
}

.sticky-chat-icon > div:last-child { /* The wave effect */
  position: absolute;
  width: 80px;
  height: 80px;
  background: #8800f8;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.4;
  animation: wave 2s infinite linear;
}

@keyframes wave {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.4;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
  }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .main-header {
    padding: 10px 20px;
  }

  .main-nav {
    display: none; /* Hide desktop nav on mobile */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
  }

  .site-title {
    font-size: 20px;
  }

  .header-logo-img {
    width: 35px;
    height: 35px;
  }

  /* Main content wrapper padding adjustment */
  .content-wrapper {
    padding: 20px 15px;
  }

  .container {
    padding: 20px;
  }

  .page-title {
    font-size: 24px;
    flex-direction: column; /* Stack icon and text on smaller screens */
    gap: 10px;
  }
  .icon-small {
    margin-left: 0;
    margin-right: 0;
  }

  .top-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .btn, .btn-outline {
    width: 100%; /* Full width buttons */
    padding: 12px 15px;
    font-size: 15px;
  }

  .drop-area {
    padding: 30px 15px;
  }

  .drop-area p {
    font-size: 15px;
  }

  /* Info section adjustments */
  .info-section {
    padding: 20px;
    margin: 10px auto;
  }
  .info-section .info-header-h1 {
    font-size: 1.7rem;
    text-align: center;
  }
  .info-section h2 {
    font-size: 1.3rem;
  }
  .info-section h3 {
    font-size: 1.1rem;
  }
  .info-section p, .info-section ul, .info-section li {
    font-size: 0.95rem;
    text-align: left;
  }

  /* Footer responsiveness */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-section {
    padding: 15px 0;
  }

  .footer-logo-section {
    justify-content: center;
  }

  .footer-section p, .footer-section ul {
    text-align: center;
  }
  .footer-section ul {
    align-items: center;
  }

  /* Sticky chat icon responsive adjustments */
  .sticky-chat-icon {
    bottom: 20px !important;
    right: 20px !important;
  }

  .sticky-chat-icon > div:first-child {
    width: 45px !important;
    height: 45px !important;
  }

  .sticky-chat-icon svg {
    width: 22px !important;
    height: 22px !important;
  }

  .sticky-chat-icon > div:last-child {
    width: 65px !important;
    height: 65px !important;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 20px;
  }

  .drop-area {
    padding: 25px 10px;
  }

  .drop-area p {
    font-size: 14px;
  }
  .info-section .info-header-h1 {
    font-size: 1.5rem;
  }
  .info-section h2 {
    font-size: 1.2rem;
  }
  .info-section h3 {
    font-size: 1rem;
  }
}